package seehope.reflect;

public class Person {
    public String name;
    private int age;
    public Person(){
        this.name = "张三";
        this.age = 18;
    }
    public Person(String name, int age){
        super();
        this.name = name;
        this.age = age;
    }
    private Person(String name){
        super();
        this.name = name;
    }

    @Override
    public String toString() {
        return "Person{" +
                "name='" + name + '\'' +
                ", age=" + age +
                '}';
    }

    public void eat(){
        System.out.println("今天吃了一顿大餐");
    }

    public void eat(int num){
        System.out.println("今天吃了" + num + "顿大餐");
    }

    private void sleep(){
        System.out.println("美滋滋的睡了一觉");
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }
}
